export function configForm () {
  return  [
    {
      fieldName: "采购包或标段编码",
      field: "crsrm_bidding_id",
      value: "",
      type: "input",
      placeholder: "请输入采购包或标段编码"
    },
    {
      fieldName: "采购包或标段名称",
      field: "crsrm_bidding_name",
      value: "",
      type: "input",
      placeholder: "请输入采购包或标段名称"
    },
    {
      fieldName: "合同名称",
      field: "crsrm_contract_name",
      value: "",
      type: "input",
      placeholder: "请输入合同名称"
    },
    {
      fieldName: "合同编号",
      field: "crsrm_contract_code",
      value: "",
      type: "input",
      placeholder: "请输入合同编号"
    },
    {
      fieldName: "更新时间从",
      field: "start_date",
      aliasField: 'startDate',
      value: "",
      type: "date",
      placeholder: "请选择"
    },
    {
      fieldName: "更新时间至",
      field: "end_date",
      aliasField: 'endDate',
      value: "",
      type: "date",
      placeholder: "请选择"
    },
    {
      fieldName: "数据来源",
      field: "crsrm_data_source",
      value: "",
      type: "select",
      placeholder: "请选择数据来源",
      optionList: this.crsrm_pur_data_source
    },

    {
      fieldName: "数据状态",
      field: "crsrm_state",
      value: "",
      type: "select",
      placeholder: "请选择润智采-数据状态",
      optionList: this.crsrm_pur_state
    },

/*    {
      fieldName: "上报国资委状态",
      field: "push_state",
      value: "",
      type: "select",
      optionList: this.crsrm_push_state
    },*/
    {
      fieldName: "校验结果",
      field: "resultState",
      value: [],
      type: "select",
      optionList: this.crsrm_pur_result_state,
      isMul: true,
    },
    {
      fieldName: "整改状态",
      field: "crsrm_rectify_flag",
      value: "",
      type: "select",
      optionList: this.crsrm_rectify_flag,
    },
  ];
}

export function generateColumns() {
  return [
    {
      type: "selection",
      width: 60,
      align: "center",
      fixed: "left"
    },
    {
      title: '校验结果',
      align: "center",
      key: 'resultState',
      render: (h, { row }) => {
        return this.resultHandle(h, row)
      }
    },
    {
      title: "数据状态",
      key: "crsrmStateStr",
      render: (h, { row }) => {
        return this.dataStateHandle(h, row)
      }
    },
    {
      title: "数据来源",
      key: "crsrmDataSourceStr"
    },
    {
      title: "采购包或标段编号",
      key: "crsrmBiddingId",
      minWidth: 160
    },
    {
      title: "采购包或标段名称",
      key: "crsrmBiddingName",
      minWidth: 160
    },
    {
      title: "采购人名称",
      key: "crsrmPurchaserName"
    },
    {
      title: "采购人代码",
      key: "crsrmPurchaserCode"
    },
    {
      title: "合同编号",
      key: "crsrmContractCode"
    },
    {
      title: "合同名称",
      key: "crsrmContractName"
    },
    {
      title: "合同主要标的类别",
      key: "crsrmCategoryCodeStr",
      minWidth: 160
    },
    {
      title: "合同签订时间",
      key: "crsrmSignedDatetime"
    },
    {
      title: '合同计价方式',
      key: 'crsrmValuationTypeStr'
    },
    {
      title: "合同金额",
      key: "crsrmAmount"
    },
    {
      title: "付款方式",
      key: "crsrmPayTypeStr"
    },
    {
      title: "合同约定开始时间",
      key: "crsrmStartDatetime",
      minWidth: 160
    },
    {
      title: "合同约定结束时间",
      key: "crsrmEndDatetime",
      minWidth: 160
    },
    {
      title: "履约地点",
      key: "crsrmPerformancePlace"
    },
    {
      title: "履约担保",
      key: "crsrmGuaranteeTypeStr"
    },
    {
      title: '流程状态',
      width: 180,
      resizable:true,
      key: 'bpmnState',
      render: (h, { row }) => {
        return this.bpmn_stateHandle(h, row)
      }
    },
    {
      title: "整改状态",
      key: "crsrmRectifyFlagStr",
      minWidth: 130
    },
    {
      title: "更新时间",
      key: "crsrmUpdateTime",
      minWidth: 150
    },
/*    {
      title: "上报国资委状态",
      key: "pushStateStr",
      minWidth: 150
    },*/
    {
      title: "操作",
      align: "left",
      fixed: "right",
      width: 100,
      render: (h, { row }) => {
        return h("RowTools", {
          props: {
            data: [
              {
                type: 'icon',
                icon: 'md-eye',
                text: '查看',
                handle: () => this.detailHandle(row.id)
              },
              {
                type: 'icon',
                icon: 'md-document',
                text: '历史记录',
                handle: () => this.historyRecord(row, 'contract/history')
              }
            ]
          }
        });
      }
    }
  ];
}

export const detailField = {
  baseInfo: {
    crsrmBiddingId: {
      name: "采购包或标段编码",
      type: 'input'
    },
    crsrmBiddingName: {
      name: '采购包或标段名称',
      type: 'input'
    },
    crsrmPurchaserSbu: {
      name: "采购人所属的一级利润中心",
      type: 'select'
    },
    crsrmPurchaserName: {
      name: "采购人名称",
      type: 'input'
    },
    crsrmPurchaserCode: {
      name: "采购人代码",
      type: 'input'
    },
    crsrmFrameworkAgreementId: {
      name: "框架协议编号",
      type: 'input'
    },
    crsrmContractCode: {
      name: "合同编号",
      type: 'input'
    },
    crsrmContractName: {
      name: "合同名称",
      type: 'input'
    },
    crsrmCategoryCode: {
      name: "合同主要标的类别",
      type: 'select'
    },
    crsrmSignedDatetime: {
      name: "合同签订时间",
      type: 'input'
    },
    crsrmValuationTypeStr: {
      name: "合同计价方式",
      type: 'input'
    },
    crsrmAmount: {
      name: "合同金额",
      type: 'input'
    },
    crsrmPayTypeStr: {
      name: "付款方式",
      type: 'input'
    },
    crsrmStartDatetime: {
      name: "合同约定开始时间",
      type: 'input'
    },
    crsrmEndDatetime: {
      name: "合同约定结束时间",
      type: 'input'
    },
    crsrmPerformancePlace: {
      name: "履约地点",
      type: 'input'
    },
    crsrmGuaranteeTypeStr: {
      name: "履约担保",
      type: 'input'
    },
    crsrmNote: {
      name: "备注",
      type: 'input'
    },
    crsrmState: {
      name: "数据状态（润智采）",
      type: 'select'
    },
    crsrmRectifyFlag: {
      name: "整改状态",
      type: 'select'
    }
  },
  submitInfo: {
    crsrmSourceSystemNumStr: {
      name: "来源系统",
      type: 'input'
    },
    crsrmDataSourceStr: {
      name: "数据来源",
      type: 'input'
    },
    crsrmUpdateTime: {
      name: "更新时间（润智采）",
      type: 'input'
    },
    crsrmReporterLdap: {
      name: "报送人账号",
      type: 'input'
    },
    crsrmReporterName: {
      name: "报送人姓名",
      type: 'input'
    },
    crsrmReporterEmail: {
      name: "报送人邮箱",
      type: 'input'
    },
    crsrmReporterPhoneNum: {
      name: "报送人手机号码",
      type: 'input'
    },
  },
};

